package com.example.service;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

import javax.jms.Destination;

/**
 * Description
 * ...
 * DATE 2017/11/15.
 *
 * @author Mr. Chun.
 */
@Component
public class Producer {
    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    public void sendMessage(final String message) {
        Destination destination = new ActiveMQQueue("com_xxx_question_change_status.queue");
        jmsMessagingTemplate.convertAndSend(destination, message);
    }
}
